﻿namespace Purest.SqlSugar.Entity;

/// <summary>
/// 商户表
/// </summary>
public partial class MerchantEntity
{
    /// <summary>
    /// 是否启用
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public bool IsEnable => this.Status.HasFlag(MerchantStatusEnum.Enable);

    /// <summary>
    /// 是否可以代收
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public bool Payable => this.Status.HasFlag(MerchantStatusEnum.Enable) && this.Status.HasFlag(MerchantStatusEnum.Payable);

    /// <summary>
    /// 是否可以代付
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public bool Collectable => this.Status.HasFlag(MerchantStatusEnum.Enable) && this.Status.HasFlag(MerchantStatusEnum.Collectable);
}


[Flags]
public enum MerchantStatusEnum
{
    None = 0,
    Enable = 1,
    Payable = 2,
    Collectable = 4,
}